{include file="public/_meta" title="栏目列表"/}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
	<span class="c-gray en">&gt;</span>
	系统管理
	<span class="c-gray en">&gt;</span>
	栏目列表
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
	<form action="" method="get">
		<div class="text-c">
			<input type="text" name="keywords" placeholder="请输入栏目名称、" style="width:250px" class="input-text">
			<button name="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</div>
	</form>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l">
		<a href="javascript:;" onclick="dataDel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
		<a class="btn btn-primary radius" onclick="add_menu_list('添加栏目','{:url(\'system/add_menu_list\')}','800','400')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加栏目</a>
		</span>
		<span class="r">共有数据：<strong>54</strong> 条</span>
	</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-hover table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="80">ID</th>
					<th>栏目名称</th>
					<th>模块名称</th>
					<th>控制器名称</th>
					<th>方法名称</th>
					<th width="100">栏目级别</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
			{volist name="list" id="vo"}
				<tr class="text-c">
					<td><input type="checkbox" name="id[]" value=""></td>
					<td>{$vo.id}</td>
					<td style="text-align:left"><?php echo str_repeat('&nbsp;',$vo['level']*6)?>{$vo.list_name}</td>
					<td>{$vo.module}</td>
					<td>{$vo.controller}</td>
					<td>{$vo.function}</td>
					<td>{$vo.level + 1}级栏目</td>
					<td class="f-14"><a title="编辑" href="javascript:;" onclick="edit_menu_list('栏目编辑','{:url(\'system/edit_menu_list\')}?id={$vo.id}','{$vo.id}','800','400')" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
						<a title="删除" href="javascript:;" onclick="del_menu_list(this,'{$vo.id}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
				</tr>
			{/volist}
			</tbody>
		</table>
	</div>
</div>
<!--_footer 作为公共模版分离出去-->
{include file="public/_footer" /}
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">
$('.table-sort').dataTable({
	//"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	//"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,7]}// 制定列不参与排序
	]
});
/*添加-菜单-栏目*/
function add_menu_list(title,url,w,h){
	layer_show(title,url,w,h);
}
/*系统-栏目-编辑*/
function edit_menu_list(title,url,id,w,h){
	layer_show(title,url,w,h);
}
/*系统-栏目-删除*/
function del_menu_list(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'get',
			url: "{:url('system/del_menu_list')}",
			dataType: 'json',
			data: {id:id},
			success: function(msg){
				if(msg.status == true){
					$(obj).parents("tr").remove();
					layer.msg(msg.message,{icon:6,time:1000});
				}else if(msg.status == false){
					layer.msg(msg.message,{icon:5,time:1000});
				}else{
					layer.msg(data,{icon:5,time:2000});
				}
			},
			error:function(data) {
				console.log(data.msg);
			}
		});
	});
}
</script>
